//
//  SetupViewController.m
//  HomeFinder
//
//  Created by zhenguanqing on 16/2/26.
//  Copyright © 2016年 蒋永昌. All rights reserved.
//

#import "SetupViewController.h"

@interface SetupViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic,strong)UITableView *setupTableView;
@property(nonatomic,strong)NSMutableArray *dataArray;



@end

@implementation SetupViewController


-(void)viewWillAppear:(BOOL)animated{
    
    self.tabBarController.tabBar.hidden = YES;
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.setupTableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
    
    self.view = self.setupTableView;
    
    self.setupTableView.delegate = self;
    self.setupTableView.dataSource = self;
    
    NSArray *section1 = [NSArray arrayWithObjects:@"消息推送", nil];
    NSArray *section2 = [NSArray arrayWithObjects:@"清除缓存",@"检查更新", nil];
    
    self.dataArray = [NSMutableArray arrayWithObjects:section1,section2, nil];

    self.navigationItem.title = @"系统设置";
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"Comment_Icon_Back"] style:UIBarButtonItemStylePlain target:self action:@selector(gobackAction:)];

    
}

-(void)gobackAction:(UIBarButtonItem*)sender{

    [self.navigationController popViewControllerAnimated:YES];

}


-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return [self.dataArray count];
    
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    
    return [self.dataArray[section] count];
    
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    cell.textLabel.text = self.dataArray[indexPath.section][indexPath.row];
    return cell;
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
